package com.alibaba.Day05;

public class Vehicle {

    private int speed;
    private int size;

    public Vehicle() {
    }

    public Vehicle(int speed, int size) {
        this.speed = speed;
        this.size = size;
    }


    public void move(){
        System.out.println("begin to move");
    }

    public int speedUp(int time){
        speed = speed + time;
        return speed;
    }

    public int speedDown(int time){
        speed = speed - time;
        return speed;
    }

    /**
     * 获取
     * @return speed
     */
    public int getSpeed() {
        return speed;
    }

    /**
     * 设置
     * @param speed
     */
    public void setSpeed(int speed) {
        this.speed = speed;
    }

    /**
     * 获取
     * @return size
     */
    public int getSize() {
        return size;
    }

    /**
     * 设置
     * @param size
     */
    public void setSize(int size) {
        this.size = size;
    }

    public String toString() {
        return "Vehicle{speed = " + speed + ", size = " + size + "}";
    }
}
